package com.phevos.knowledge.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class RatingsId extends BaseObject implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 7253517743833427462L;
    private BigDecimal userId;
    private BigDecimal artId;


    @Column(name="user_id", nullable=false, precision=38, scale=0)
    public BigDecimal getUserId() {
        return this.userId;
    }
    
    public void setUserId(BigDecimal userId) {
        this.userId = userId;
    }

    @Column(name="art_id", nullable=false, precision=38, scale=0)
    public BigDecimal getArtId() {
        return this.artId;
    }
    
    public void setArtId(BigDecimal artId) {
        this.artId = artId;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RatingsId pojo = (RatingsId) o;

        if (userId != null ? !userId.equals(pojo.userId) : pojo.userId != null) return false;
        if (artId != null ? !artId.equals(pojo.artId) : pojo.artId != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = (artId != null ? artId.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("userId").append("='").append(getUserId()).append("', ");
        sb.append("artId").append("='").append(getArtId()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
